package com.ruoyi.iot.mapper;

import com.ruoyi.iot.dto.Weather;
import com.ruoyi.iot.vo.DustVO;
import com.ruoyi.iot.vo.WeatherVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.Instant;
import java.util.List;

@Mapper
public interface WeatherMapper {

    List<WeatherVO> get(@Param("sensorId") String sensorId, @Param("startTime") Instant startTime, @Param("endTime") Instant endTime);

    WeatherVO getNew(@Param("sensorId") String sensorId);

    List<WeatherVO> getRange(@Param("sensorId") String sensorId,
                          @Param("targetPoints") Integer targetPoints,
                          @Param("startTime") Instant startTime,
                          @Param("endTime") Instant endTime);

    void batchInsert(List<Weather> weatherList);
}
